clear all
set mem 100m
local path0="C:\Dropbox\GeneticsProject (1)\REStat\round_accepted_replication_files\"
local path1="C:\Dropbox\GeneticsProject (1)\REStat\round_accepted_replication_files\outregs"

set more off

*============================================================
*** 				US-born persons: 
***					Census 2000
*============================================================
cd "`path0'Data\IPUMS_2000"
use research_career_propensity_USborn.dta, clear

replace idv=idv/100


*~~~~~~~~~~~~~~~~ 	OLS regression ~~~~~~~~~~~~~~~~~~~~~~~~
*** narrow definition of research occupations
rreg  coef1w_so idv, gen(reg_001)
outreg2  idv using "`path1'\RR_table008A.txt" , ///
		replace bdec(3) rdec(3) aster nocons nolabel ctitle("all: US born") 	
	
rreg  coef3w_so idv, gen(reg_002)
outreg2  idv using "`path1'\RR_table008A.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("college edu: US born") 	

*============================================================
*** 				US-born persons
***					Census 1970
*============================================================
cd "`path0'data\ipums_1970"
use step301_USborn.dta, clear

replace idv=idv/100

*~~~~~~~~~~~~~~~~ 	OLS regression ~~~~~~~~~~~~~~~~~~~~~~~~
*** narrow definition of research occupations
rreg  coef1_so idv, gen(reg_001)
outreg2  idv using "`path1'\RR_table008A.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("all: US born 1970") 	
	
rreg  coef3_so idv, gen(reg_002)
outreg2  idv using "`path1'\RR_table008A.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("college edu: US born 1970") 	


	
*============================================================
*** 				All persons
***					Census 2000
*============================================================
cd "`path0'Data\IPUMS_2000"
use research_career_propensity_all.dta, clear
replace idv=idv/100

*** narrow definition of research occupations
rreg  coef1w_so idv
outreg2  idv using "`path1'\RR_table008B.txt" , ///
		replace bdec(3) rdec(3) aster nocons nolabel ctitle("all: all born") 	
	
rreg  coef3w_so idv
outreg2  idv using "`path1'\RR_table008B.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("college edu: all born") 	


		
*============================================================
*** 				All persons
***					Census 1970
*============================================================

cd "`path0'data\ipums_1970"

use step302_all_people.dta, clear
replace idv=idv/100

*** narrow definition of research occupations
rreg  coef1_so idv
outreg2  idv using "`path1'\RR_table008B.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("all: all born: 1970") 	
	
rreg  coef3_so idv
outreg2  idv using "`path1'\RR_table008B.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("college edu: all born: 1970") 	


	
	
